﻿<%@ Page Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="ThaoLuan.aspx.cs" Inherits="MasterPageGroupF3.WebForm3" Title="Untitled Page" %>
<%@ Import Namespace="BUS" %>
<%@ Import Namespace="DTO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ul class="clsmenuul">
        <li><a href="index.aspx">GIÁ TỐT HÔM NAY </a></li>
        <li><a href="GiaTotGanDay.aspx">GIÁ TỐT GẦN ĐÂY</a> </li>
        <li><a href="GiaTotSapToi.aspx">GIÁ TỐT SẮP TỚI</a> </li>
         <% if (Session["Provider"] != null)
            {%>
                <li><a href="DangTinKhuyenMai.aspx">ĐĂNG TIN KHUYẾN MÃI</a> </li> 
                 <li><a href="DanhSachDonDatHang.aspx">DS ĐƠN ĐẶT HÀNG</a> </li>
           <%}
            if (Session["UserName"] != null)
            {%>
                <li><a href="LichSuMuaHang.aspx">LỊCH SỬ MUA HÀNG</a> </li> 
                 <li><a href="TinhTrangDonHang.aspx">TÌNH TRẠNG ĐƠN HÀNG</a> </li>
            <%} %>
        <li class="active"><a href="ThaoLuan.aspx">THẢO LUẬN</a> </li>
        <li><a href="TroGiup.aspx">TRỢ GIÚP</a> </li>        
    </ul>         
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<div>
<img src="../images/thao luan.jpg" width="706px" alt="center"/>
</div>
<div id="Products">
        
 <%
    int s = 0;
    if (Request.QueryString["pageID"] == null)
    {
        s = 1;
    }
    else s = int.Parse(Request.QueryString["pageID"].ToString());
    
    PRODUCT[] pro = BUS.PRODUCTBUS.LayBang();
    int count = pro.Count();
    int tam = s*6;
    if (s * 6 > count)
    {
        tam = count;
    }
    for (int i = (s - 1) * 6; i < tam; ++i)
    {
        
        String slogan = pro[i].SLOGAN.ToString();
        string image = "images/product/" + pro[i].IDPRODUCT.ToString() + "/1.jpg";
        if(slogan.Length>=20)
            slogan = slogan.Substring(0, 20)+"...";
    %>  

    <div class="Producty">
        <img src="<%Response.Write(image); %>" alt="center" width="120px" height="120px"/>
            <br />
            <%Response.Write(slogan); %>
            <br />
        <i><a href="comment.aspx?IDProduct=<% Response.Write(pro[i].IDPRODUCT); %>" style="color:Red">comment</a></i>
    </div>  
    <%
        }
         %>
</div>

<div class="frame1" >

    <asp:ImageButton ID="ImageButton1" runat="server" 
        ImageUrl="~/images/previous.png" Width="32px" 
        onclick="ImageButton1_Click" />
    <asp:ImageButton ID="ImageButton2" runat="server" 
        ImageUrl="~/images/go-next.png" onclick="ImageButton2_Click" />

</div>
</asp:Content>
